<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>编辑地址</title>
    <link rel="stylesheet" type="text/css" href="css/css1.css"/>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
    <script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.js"></script>

    <style type="text/css">
        body{
            margin: 0;
            padding: 0;
        }
        p{
            margin: 0;
        }
         a{
        	text-decoration: none;
        	color: #000;
        }
        h2{
            margin: 0;
            padding: 0;
            font-weight: 300;
        }
        ol,ul{
            list-style: none;
            margin: 0;
            padding-left: 0;
        }
       
        .pull-right{
            float: right;
        }
        .pull-left{
            float: left;
        }
        .hide{
            display: none;
        }
        .block{
            display: block;
        }
        .me-page{
            width: 990px;
            margin: 20px auto;
        }
        .home-navigation{
            width: 180px;
            float: left;
            margin-right: 8px;
            border: 1px solid #dedede;
        }
        .home-navigation p{
            height: 40px;
            line-height: 40px;
            padding: 0 8px;
            margin: 0;
            background-color: #e3e3e3;
            font-size: 20px;
            font-weight: 700;
        }
        .home-navigation p span{
            font-size: 9px;
            font-weight: 300;
            vertical-align: middle;
        }

        .user-thumb{
            padding: 20px 0;
        }
        .thumb-bg{
            width: 100px;
            height: 100px;
            margin: 0 auto;
            padding: 5px 7px 7px 5px;
        }
        .thumb-bg img{
            width: 100px;
            height: 100px;
        }
        .nav-title{
            height: 38px;
            line-height: 38px;
            font-size: 14px;
            border-top: 1px solid #ccc;
            color: black;
            background: #e6e6e6;
            margin: 0;
            padding-left: 0;
        }
        .title-icon{
            float: left;
            display: block;
            width: 15px;
            height: 15px;
            margin: 12px 10px 0;
            background: url("images/ucenter/nav-group.png");
        }
        .nav-group .nav-row.first{
            border-top: none;
        }
        .nav-group .nav-row{
            height: 38px;
            line-height: 38px;
            border-top: 1px solid #e2e2e2;
            padding-left: 35px;
            color: #666;
            background: #f8f8f8;
            font-size: 12px;
            cursor: pointer;
        }
        .nav-group .nav-row:hover{
            background-color: white;
            color: #666;
        }
        .nav-group ul li.active{
            background: #636363;
            color: #e3e3e3;
        }
        .me-main{
            float: left;
            color: black;
            width: 800px;
            box-sizing: border-box;
        }
        .latest-order{
            margin-bottom: 10px;
        }
        .latest-order .title{
            height: 40px;
            line-height: 40px;
            padding: 0 8px;
            background: #e3e3e3;
        }
        .latest-order .title>span{
            float: left;
            font-size: 16px;
            font-weight: 700;
        }
        .swindle-info{
            margin: 10px;
            background-color: #e6e6e6;
            color: black;
            font-size: 12px;
            padding: 10px;
        }
        .my-address{
            font-size: 13px;
            margin: 0 auto;
        }
        .my-address p{
            margin-left: 14px;
            margin-top: 3px;
        }
        .my-address p:nth-child(1){
            margin-top: 10px;
        }
        .my-address p:nth-child(3){
            margin-bottom: 10px;
        }
        .add-address{
            padding: 14px;
        }
        .add{
            border-bottom: 1px solid #e0e0e0;
        }
    </style>
</head>
<body>
<div id="app-userAddress">
    <div class="top">
        <div class="top-list">
            <div class="top-left" v-show="!isLogin">
                <a href="#"><span>雷猴~</span></a>
                <a href="login.html"><span>[请登录]</span></a>
                <a href="register.html"><span>[注册]</span></a>
            </div>
            <div class="top-right">
                <a href="user-center.html" v-show="isLogin"><span>{{ nickname }}</span></a>
                <a href="javascript:void(0)"><span style="cursor: pointer" @click="quitLogin" v-show="isLogin">[退出]</span></a>
                <a href="user-order.html"><span>我的订单</span></a>
                <a href="user-collect.html"><span>我的收藏</span></a>
            </div>
        </div>
    </div>
    <!--首页-->
    <div class="head-logo">
        <div class="head-inner">
            <!--logo-->
            <div class="header-logo">
                <a href="index.html"><img src="images/logo.png" alt="乐鲜生活" height="80" /></a>
            </div>
            <!--购物车-->
            <div class="buyCar">
                <a href="buy-cart.html">
                    <span class="shopping-bag-icon"></span>
                </a>
            </div>
            <div class="header-search">
                <!--搜索框-->
                <div class="search-form">
                    <input type="text" name="search-content" class="header-search-input" maxlength="100" placeholder="搜一哈你想搜的内容"  />
                    <a href="#" class="header-search-button">
                        <span class="header-search-icon"></span>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="header-nav">
        <div class="first-category">
            <ul class="first-category-ul">
                <li v-for="(item,index) in primaryCategory" @click="onPrimCateClick(index)" class="first-category-item">
                    <span>{{item.name}}</span>
                </li>

            </ul>

        </div>
    </div>
    <div class="me-page">
        <div class="home-navigation">
            <!-- 标题 -->
            <a href="user-center.html"><p>个人中心<span>ucenter</span></p></a>
            <!-- 头像 -->
            <div class="user-thumb">
                <div class="thumb-bg">
                    <img id="user-thumb" src="images/ucenter/1.gif" />
                </div>
            </div>
            <div class="nav-group">
                <h2 class="nav-title"><span class="title-icon"></span>交易管理</h2>
                <ul>
                    <li class="nav-row first"><a href="user-order.html">我的订单</a></li>
                    <li class="nav-row"><a href="user-collect.html">我的收藏</a></li>
                    <li class="nav-row">浏览记录</li>
                    <li class="nav-row">我的vip</li>
                </ul>
            </div>
            <div class="nav-group">
                <h2 class="nav-title"><span class="title-icon"></span>个人信息管理</h2>
                <ul>
                    <li class="nav-row first"><a href="user-message.html">编辑个人资料</a></li>
                    <li class="nav-row active">地址管理</li>
                </ul>
            </div>
        </div>
        <div class="me-main">
            <div class="latest-order">
                <h2 class="title">
                    <span>地址管理</span>
                </h2>
                <div class="swindle-info">
                    {{ msg }}
                </div>
                <ul class="list-group">
                    <li class="list-group-item" v-for="value in addresses">
                        <div class="my-address">
                            <p>收货人：<span>{{ value.rec_name }}</span></p>
                            <p>收货地址：<span>{{ value.address }}</span></p>
                            <p>电话号码：<span>{{ value.rec_phone }}</span></p>
                        </div>
                    </li>
                </ul>
                <div class="add-address pull-right">
                    <button class="btn btn-primary" v-show="showAddBtn" @click="openAddAddress">新增地址</button>
                </div>
                <div class="add-address add" v-show="showAddAddress">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label for="user-name" class="col-sm-2 control-label">收货人姓名：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="user-name" v-model="name" placeholder="收货人姓名">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="user-address" class="col-sm-2 control-label">收货人地址：</label>
                            <div class="col-sm-8">
                                <textarea class="form-control" id="user-address" v-model="address" rows="5"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="user-phone" class="col-sm-2 control-label">联系电话：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="tel" id="user-phone" v-model="tel" maxlength="11">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button class="btn btn-default" @click="addAddress">添加</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="./js/userAddress.js"></script>

</body>
</html>